//
//  WFChannelDetailImageCollectionViewCell.m
//  FAKER
//
//  Created by Jianwei on 15/11/7.
//  Copyright © 2015年 YHLai. All rights reserved.
//

#import "WFChannelDetailImageCollectionViewCell.h"
#import "FitHeader.h"
#import "WFModelSingleton.h"
@implementation WFChannelDetailImageCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createItem];
        
    }
    return self;
}
- (void)createItem
{
    _pic_imageView = [[BaseClassImageView alloc]initWithFrame:CONTENT_VIEW.frame];
    [CONTENT_VIEW addSubview:_pic_imageView];
    _pic_imageView.backgroundColor = [UIColor lightGrayColor];
    
    _titleLabel = [[BaseClassLabel alloc]initWithFrame:CGRectMake(10, CONTENT_VIEW.HEIGHT - 30, CONTENT_VIEW.WIDTH - 20, 20)];
    _titleLabel.numberOfLines = 0;
    _titleLabel.font = [UIFont fontWithBold:1 IPhone6sPlus:16 Iphone6s:15 Iphone5s:14 Iphone4s:13];
    _titleLabel.textColor = [UIColor whiteColor];
    _titleLabel.shadowColor = [UIColor blackColor];
    _titleLabel.highlighted = YES;
    _titleLabel.shadowOffset = CGSizeMake(-.1, .7);
    
    [CONTENT_VIEW addSubview:_titleLabel];
}
- (void)setModel:(WFChannelDetailModel *)model
{
    _model = model;

    [_pic_imageView sd_setImageWithURL:[NSURL URLWithString:[[_model.media objectAtIndex:0] objectForKey:@"url"]] placeholderImage:[UIImage imageNamed:@"PlaceHolder"]];
    
    _titleLabel.text = _model.title;
}

@end
